home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / ViewIt™ Shareware.sea / ViewIt™ 2.04 Shareware / FaceWare.rsrc / TEXT_1277_U4. Windows.txt < prev    next >
Text File  |  1992-08-15  |  7KB  |  104 lines

  1. U4. Windows
  2.   Several UtilIt commands are supported that deal with the managing of window-related attributes such as style, title, zoom state, order, and position.
  3.  
  4. SetFSS  183  a,b,c,d,uString,uResult
  5.   Resets the font, size, and style fields of the designated window or port.  Passing a value of -1 for b, c, or d causes UtilIt to ignore that parameter.  If the port's font, size, or style is changed, then UtilIt returns uResult ‚↠0.
  6.   a = target window or port
  7.     0 = front modal or active modeless window
  8.     1 = current port
  9.     other = WindowPtr or GrafPtr
  10.   b = font number
  11.    or b = -2 = get font name from uString
  12.    or b = address of a Pascal string containing font name
  13.   c = font size (12 pt. used if c = 0)
  14.   d = style = sum of following:  0 = Plain,
  15.     1 = Bold, 2 = Italic, 4 = Underline, 8 = Outline,
  16.     16 = Shadow, 32 = Condensed, 64 = Extended
  17. NOTE:  SetFSS does not change the appearance of text in an existing window.  It only changes the appearance of new text drawn by the program after calling SetFSS (i.e., it has the same effect as calling TextFont, TextSize, and TextFace).
  18.  
  19. SndBhd  250  a,b,d
  20.   Moves a window to a new location in the window list (i.e., above or below some other window).  SndBhd also calls ShowWindow to show the window if it is not already visible.  Avoid using SndBhd if a modal window is the front window.
  21.   a = WindowPtr of window to move
  22.   b = where to move the window in window list
  23.     1 = send to back (below all other windows)
  24.     0 = bring to front, but below any FaceIt floating palettes
  25.    -1 = bring to front using "SelectWindow"
  26.    -2 = bring to front without calling "SelectWindow"
  27.     other = WindowPtr of a window to send window a behind
  28.   d = update mode (same use as in FaceIt's DoUpdt2)
  29. The b = -1 or -2 options are primarily for FaceWare's internal use.  The most common use of SndBhd is to bring a modeless window to the front:
  30.  FaceIt(nil,SndBhd,ord(myWindow),0,0,-1);
  31. where d = -1 updates window contents and other stuff.
  32.  
  33. GetNam  251  a,b,c,uName
  34.   Returns all or part of a window's current title in uName (if c = 0), or in the Pascal string whose address is given by c, where a is the window's WindowPtr, and b designates which part of the title to return:  0 = entire title, 1 = window name only, 2 = file name only (the text between "{" and "}"), or 3 = file name if not empty, else window name.
  35. NOTE:  This command is primarily used by modules that make use of a window's title to display a file name.
  36.  
  37. SetNam  252  a,b,c,uName
  38.   Resets all or part of a window's current title to uName (if c = 0), or to the Pascal string whose address is given by c, where a is the window's WindowPtr, and b designates which part of the title to reset:  0 = entire window title, 1 = window name only, and 2 = file name only (the text in the title that is between "{" and "}").
  39. NOTE:  This command is primarily used by modules that make use of a window's title to display a file name.
  40.  
  41. MovRec  254  a,b,c,d,uRect
  42. MovAlt  255  a,b,c,d
  43. MovDlg  256  a,b,c,d
  44. MovWin  257  a,b,c,d
  45.   Moves a rectangle to the screen position designated by the parameters b, c, and d.  For MovRec, uRect is adjusted.  For MovAlt, MovDlg, and MovWin, the boundsRect of the corresponding ALRT, DLOG, or WIND resource (in memory, not on disk) whose resource ID is equal to a is adjusted.  The resulting rectangle is always kept within the visible screen area.  MovRec can also be used to move an existing window by passing a WindowPtr in parameter a.
  46.   a = resource ID of ALRT, DLOG, or WIND (not MovRec)
  47.    or window procID‚Ć (MovRec only)
  48.    or WindowPtr of window to move (MovRec only)
  49.   b = what device (screen), window, or position to use as basis for movement
  50.    -2 =  c and d are global coordinates
  51.    -1 = all devices
  52.     0 = main device (screen with menu bar)
  53.     1 = deepest device (greatest bits per pixel)
  54.     2 = front window
  55.     3 = current cursor location
  56.     4 = current device that contains cursor
  57.     5 = front modal or active modeless window
  58.     other = WindowPtr of an existing window
  59.   c = vertical placement
  60.     0 = no change
  61.     1 = centered
  62.     2 = at top
  63.     3 = at bottom
  64.     4 = 1/3 of distance from top to bottom
  65.     other = pixel offset from top
  66.   d = horizontal placement
  67.     0 = no change
  68.     1 = centered
  69.     2 = at left
  70.     3 = at right
  71.     other = pixel offset from left
  72. A typical use of MovDlg, for example, would be to adjust the boundsRect of a DLOG resource before opening a new dialog window,
  73.  FaceIt(nil,MovDlg,1000,0,1,1);
  74. which would center DLOG 1000 on the main screen.  The MovRec command, on the other hand, could be used to move a hidden window into position before it is shown:
  75.  FaceIt(nil,MovRec,ord(myWindow),5,1,1);
  76. which would center "myWindow" above the front modal or active modeless window.
  77.  
  78. ‚Ć When using MovRec to adjust the position of uRect, the procID or "window definition ID" passed in parameter a is used to account for the title bar and border area of a window that might be formed from uRect.  Use a = 2, for example, to minimize the correction for title bar and border since this procID corresponds to a window with no title bar and a minimal border.
  79.  
  80. DrgWnd  259  a,b,c,d,uRect
  81.   Drags and, if d ‚↠0, selects the designated window.  This command does not call "DragWindow" or "SelectWindow", making it useful in cases where these traps may have been patched and the caller wishes to drag and select the window in a controlled manner (ViewIt uses DrgWnd, for example, when in editing mode).
  82.   a = WindowPtr (or 0 for front modal or active modeless)
  83.   b = starting point of drag (global coordinates)
  84.   c = address of bounding rect (or 0 = use fDragRect)
  85.   d = selection and update mode
  86.     0 = don't select after drag
  87.     other = update mode defined by FaceIt's DoUpdt2
  88.  
  89. GetStd  301  a,uRect
  90.   Returns in uRect the maximum standard state zoom rect for the window designated by WindowPtr a.  The rectangle is adusted to properly fit within whichever screen device contains the top, left corner of the content area of window a.
  91.  
  92. SetStd  302  a,uRect
  93.   Uses the contents of uRect to reset the standard zoom state rectangle of the window designated by WindowPtr a. SetStd is typically called by modules after "fine tuning" the uRect returned by GetStd.
  94.  
  95. SavDlg  356  a,b,c,d
  96. SavWin  357  a,b,c,d
  97.   Updates and then saves a DLOG or WIND resource back to disk where,
  98.   a = WindowPtr to get boundsRect rectangle from
  99.   b = resource ID of DLOG (SavDlg) or WIND (SavWin)
  100.   c = value to place in refCon field of resource
  101.    (or -1 to use window's current refCon value)
  102.   d = value (0 = F, 1 = T) to put in visible field of resource
  103.    (or -1 to use window's current visibility)
  104. NOTE:  This command has been made largely obsolete by the new ViewIt module which uses custom FWND resources.